home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
176-200
/
disk_188
/
memoryclock
/
mclock.ass
< prev
next >
Wrap
Text File
|
1992-05-06
|
6KB
|
293 lines
* MCLOCK
*
* copyright by Roger Fischlin
* Dieses Programm ist Public-Domain-Soft!
* Assembler : Devpac Assembler
incdir "vd0:include/"
include intuition/intuition.i
include intuition/intuition_lib.i
include exec/memory.i
include exec/exec_lib.i
include graphics/graphics_lib.i
include libraries/dos_lib.i
include libraries/dos.i
include graphics/text.i
PRINT macro ; Macro zur Ausgabe eines Textes
move #\1,d0
move #\2,d1
move.l Window,a1
move.l wd_RPort(a1),a1
CALLGRAF Move
move #\3,d0
move.l Window,a1
move.l wd_RPort(a1),a1
CALLGRAF SetAPen
lea \4,a0
move.l #\5,d0
move.l Window,a1
move.l wd_RPort(a1),a1
CALLGRAF Text
endm
_main lea dosname,a1 ; Öffnen der DOS-Library
moveq #0,d0
CALLEXEC OpenLibrary
tst.l d0
beq abbruch
move.l d0,_DOSBase
lea intname,a1 ; Öffnen der INTUITION-Library
moveq #0,d0
CALLEXEC OpenLibrary
tst.l d0
beq closedos
move.l d0,_IntuitionBase
lea grafname,a1 ; Öffnen der GRAPHICS-Library
moveq #0,d0
CALLEXEC OpenLibrary
tst.l d0
beq closeint
move.l d0,_GfxBase
lea windowdef,a0 ; Window öffnen
CALLINT OpenWindow
tst.l d0
beq closegraf
move.l d0,Window
lea.l FONT,a0 ; Topaz-80 (ROM-Zeichensatz)
CALLGRAF OpenFont ; öffnen und benutzen
move.l d0,Font
tst.l d0
beq closewindow
move.l d0,a0
move.l Window,a1
move.l wd_RPort(a1),a1
CALLGRAF SetFont
Schleife PRINT 5,18,3,Text1,4 ; Texte (RAM,Chip, etc.) ausgeben
PRINT 5,28,3,Text2,4
PRINT 5,39,3,Text3,4
PRINT 5,49,3,Text4,4
moveq #MEMF_PUBLIC,d1 ; Freies RAM feststellen
CALLEXEC AvailMem
move.l d0,d2
lea buffer,a0
bsr makeASCII ;Zahl in ASCII-Code umwandeln
PRINT 45,18,1,buffer,8
moveq #MEMF_CHIP,d1 ; dasselbe wie oben, nur mit Chip-RAM
CALLEXEC AvailMem
move.l d0,d2
lea buffer,a0
bsr makeASCII
PRINT 45,28,1,buffer,8
move.l #Zeit,d1 ; Zeit holen
CALLDOS DateStamp
move.l Zeit+8,d0 ; 1/50 sec in dieser Minute in Sekunden
divu #50,d0 ; umwandeln
and.l #$ff,d0
lea.l Time+6,a0
bsr Convert ; in ASCII umwandeln
move.l Zeit+4,d0
divu #60,d0 ; Minuten in Stunden umwandeln
and.l #$ff,d0
lea.l Time,a0
bsr Convert ;und in ASCII umwandeln
move.l Zeit+4,d0 ; Minuten in dieser Stunde holen
divu #60,d0
lsr.l #8,d0 ; Teilerrest nehmen
lsr.l #8,d0
and.l #$ff,d0
lea.l Time+3,a0 ; und in ASCII
bsr Convert
move.l Zeit,d0 ;vergangene Tage set 1.1.78
lea.l Jahre,a0
move.l #77,d1 ; Jahreszahl feststellen
label1 addq #1,d1
sub.w (a0)+,d0
bpl label1
add.w -(a0),d0
move.l d0,d5
move.l (a0),d6
and.l #$ff,d1
cmp.w #99,d1 ; nur die letzten zwei Ziffern
bls label2
sub.w #100,d1
label2 move.l d1,d0
and.l #$ff,d0
lea.l Date+6,a0
bsr Convert ; in ASCII
btst #0,d6
beq label3
lea.l KeinSJahr,a0 ; Schaltjahr (gerade Zahl der Tage) ?
bra label4
label3 lea.l Schaltjahr,a0
label4 move.l #-1,d1 ; Monat feststellen
label5 addq #1,d1
sub.w (a0)+,d5
bpl label5
add.w -(a0),d5
move.l d1,d0
and.l #$ff,d0
lea.l Date+3,a0
bsr Convert ; in ASCII
move.l d5,d0
and.l #$ff,d0
lea.l Date+0,a0
bsr Convert ; Tag des Monats in ASCII
PRINT 45,39,1,Time,8 ; Texte ausgeben
PRINT 45,49,1,Date,8
move #0,d0 ; Linie ziehen
move #31,d1
move.l Window,a1
move.l wd_RPort(a1),a1
CALLGRAF Move
move #1,d0
move.l Window,a1
move.l wd_RPort(a1),a1
CALLGRAF SetAPen
move #135,d0
move #31,d1
move.l Window,a1
move.l wd_RPort(a1),a1
CALLGRAF Draw
move.l Window,a0 ; CloseWindow ?
move.l wd_UserPort(a0),a0
CALLEXEC GetMsg
tst.l d0
bne ende
move.l #40,d1 ; anderen Task Zeit lassen
CALLDOS Delay
bra Schleife
ende move.l d0,a1
CALLEXEC ReplyMsg
move.l Font,a1 ; alles schließen
CALLGRAF CloseFont
closewindow move.l Window,a0
CALLINT CloseWindow
closegraf move.l _GfxBase,a1
CALLEXEC CloseLibrary
closeint move.l _IntuitionBase,a1
CALLEXEC CloseLibrary
closedos move.l _DOSBase,a1
CALLEXEC CloseLibrary
abbruch moveq #0,d0
rts
makeASCII moveq #7,d0 ; Zahl (d2) in ASCII umwandeln
lea.l buffer,a0
lea.l Potenzen,a1
next move #"0",d1
labela addq #1,d1
sub.l (a1),d2
bcc labela
subq #1,d1
add.l (a1),d2
move.b d1,(a0)+
tst.l (a1)+
dbra d0,next
moveq #6,d0
lea buffer,a0
clear cmp.b #'0',(a0)
bne fini
move.b #' ',(a0)+
dbra d0,clear
fini rts
Potenzen dc.l 10000000
dc.l 1000000
dc.l 100000
dc.l 10000
dc.l 1000
dc.l 100
dc.l 10
dc.l 1
dc.l 0
W_Gadgets equ WINDOWDRAG!WINDOWDEPTH!WINDOWCLOSE!WINDOWSIZING
W_Extras equ SMART_REFRESH!ACTIVATE
Text1 dc.b "RAM "
even
Text2 dc.b "Chip"
even
Text3 dc.b "Time"
even
Text4 dc.b "Date"
even
Time dc.b "xx:xx:xx"
even
Date dc.b "xx.xx.xx"
even
windowdef dc.w 500,140
dc.w 135,53
dc.b -1,-1
dc.l CLOSEWINDOW
dc.l W_Gadgets!W_Extras
dc.l 0
dc.l 0
dc.l 0
dc.l 0
dc.l 0
dc.w 135,21
dc.w 135,53
dc.w WBENCHSCREEN
intname INTNAME
grafname GRAFNAME
dosname DOSNAME
buffer ds.b 10
Zeit ds.l 3
_IntuitionBase ds.l 1
_GfxBase ds.l 1
_DOSBase ds.l 1
Window ds.l 1
TEXT ds.b 2
Font dc.l 0
FONT dc.l fontname
dc.w TOPAZ_EIGHTY
dc.b FS_NORMAL
dc.b FPF_ROMFONT
even
fontname dc.b "topaz.font",0
even
Convert move.l d0,d4 ; Zahl (d0) in ASCII (2 Zeichen)
divu #10,d0
move.l d0,d2
mulu #10,d2
add.w #"0",d0
move.b d0,(a0)+
sub.w d2,d4
add.w #"0",d4
move.b d4,(a0)+
rts
Jahre dc.w 365,365 ; Anzahl der Tage im Jahr (seit 1978)
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 365,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
dc.w 366,365,365,365,365
KeinSJahr dc.w 31,28,31,30,31,30,31,31,30,31,30,31 ; Anzahl der Tage im Jahr
Schaltjahr dc.w 31,29,31,30,31,30,31,31,30,31,30,31 ; " " " " Schaltjahr